#ifndef SCHEDULER_H_
#define SCHEDULER_H_

#include <iostream>
#include <list>
#include <iterator>
#include <vector>
using namespace std;

class Ghost;
class Event;
class Universe;
class CollisionSolver;

class Scheduler
{
public:

    Scheduler(Universe * universe);
    virtual ~Scheduler();
    
    void executeTimeFrame();

    // WARNING: won't delete events (less heap trashing)
    void scheduleEvent(Event * event);
    
private:

    void generateFrame();

    // all elements, that want to be called
    // so they can add events
    std::list<Ghost *> active;
    
    // all the events we got
    std::list<Event *> schedule;
    
    // our events organised
    std::list<Event *> organised;
    
    Universe * universe;
    CollisionSolver * collisionSolver;
};

#endif /*SCHEDULER_H_*/

